package cn.huoyingkeji.common.service;

import java.util.List;
import java.util.Set;

import com.baomidou.mybatisplus.core.metadata.IPage;

import cn.huoyingkeji.common.domain.DTO;
import cn.huoyingkeji.common.domain.Page;
import cn.huoyingkeji.common.exception.SharpknifeException;

/**
 * service封装
 */
public interface BaseService<D extends DTO> {

    /**
     * 添加
     */
    D add(D dto) throws SharpknifeException;

    /**
     * 修改
     */
    D update(D dto) throws SharpknifeException;


    /**
     * 删除
     * @param id
     * @return
     * @throws SharpknifeException
     */
    Boolean del(Long id) throws SharpknifeException;


    /**
     * 删除
     * @param ids
     * @return
     * @throws SharpknifeException
     */
    Boolean del(Set<Long> ids) throws SharpknifeException;



    /**
     * 删除
     * @param dto
     * @return
     * @throws SharpknifeException
     */
    Boolean del(D dto) throws SharpknifeException;


    /**
     * 详情
     * @param id
     * @return
     * @throws SharpknifeException
     */
    D details(Long id) throws SharpknifeException;


    /**
     * 分页查询
     * @param pageDTO
     * @return
     * @throws SharpknifeException
     */
    IPage<D> page(Page page,D dto) throws SharpknifeException;


    /**
     * 查询
     * @param dto
     * @return
     * @throws SharpknifeException
     */
    List<D> all(D dto) throws SharpknifeException;

}
